package com.dlws.modules.price.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dlws.modules.price.entity.Price;
import com.dlws.modules.price.entity.PricePageVo;
import com.dlws.modules.price.mapper.PriceMapper;
import com.page.Pagination;

/**
 * 
 * 描述：
 * 创建人： 魏泽超
 * 创建时间: 2016-6-21 上午9:45:26
 * @version
 */
@Service
public class PriceServiceImpl implements PriceService{
	
	@Autowired
	private PriceMapper pmMapper;

	@Override
	public Price queryOne(Price record) {
		// TODO Auto-generated method stub
		return pmMapper.selectOne(record);
	}

	@Override
	public List<Price> queryAll(Price record) {
		// TODO Auto-generated method stub
		return pmMapper.select(record);
	}

	@Override
	public int queryCount(Price record) {
		// TODO Auto-generated method stub
		return pmMapper.selectCount(record);
	}

	@Override
	public Price queryByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return pmMapper.selectByPrimaryKey(key);
	}

	@Override
	public int add(Price record) {
		// TODO Auto-generated method stub
		return pmMapper.insert(record);
	}

	@Override
	public int addSelective(Price record) {
		// TODO Auto-generated method stub
		return pmMapper.insertSelective(record);
	}

	@Override
	public int delete(Price record) {
		// TODO Auto-generated method stub
		return pmMapper.delete(record);
	}

	@Override
	public int deleteByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return pmMapper.deleteByPrimaryKey(key);
	}

	@Override
	public int updateByPrimaryKey(Price record) {
		// TODO Auto-generated method stub
		return pmMapper.updateByPrimaryKey(record);
	}

	@Override
	public int updateByPrimaryKeySelective(Price record) {
		// TODO Auto-generated method stub
		return pmMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int queryCountByExample(Price example) {
		// TODO Auto-generated method stub
		return pmMapper.selectCountByExample(example);
	}

	@Override
	public List<Price> queryByExample(Price example) {
		// TODO Auto-generated method stub
		return pmMapper.selectByExample(example);
	}

	@Override
	public Pagination pagelist(PricePageVo price) {
		// TODO Auto-generated method stub
		Pagination pagination=new Pagination(price.getPageNo(),price.getPageSize(),pagecount(price));
		pagination.setList(pmMapper.pagelist(price));
		return pagination;
	}

	@Override
	public int pagecount(PricePageVo price) {
		// TODO Auto-generated method stub
		return pmMapper.pagecount(price);
	}

}
